<?

/**
* @property DB_active_record $db
* @property Base_flexmodel $base_flexmodel
* */
class Dgp_zone extends Base_flexmodel {

	function __construct()
	{
		parent::__construct();
		$this->init('gis_lyr_dgp_zone' , 'object_id' , 'object_name');
	}

	function getAll ()
	{
		return parent::get ( 'object_name' , 'asc' );
	}
	
	function getEstateList_withRegion ()
	{
		//$this->db->join('related_parent', 'related_parent.object_id = gis_lyr_dgp_zone.object_id');
		parent::set_join( 'related_parent', 'related_parent.object_id = gis_lyr_dgp_zone.object_id' );
		parent::set_order( 'related_parent.parent_id', 'asc' );
		parent::set_order( 'object_name', 'asc' );
		//return parent::get('object_name' , 'asc' );
		return parent::get();
		//return parent::get_where ( array('related_parent.parent_id x' => $regionId ) );
	}
	
	function getRegionList ()
	{
		$regionList = array ( '1' => 'CENTRAL' , '2' => 'EAST' , '3' => 'NORTH-EAST' , '4' => 'NORTH' , '5' => 'WEST' , '6' => 'JOHOR' );
		return $regionList;
	}
	
}
